import request from '@/utils/request'

// 获取志愿者列表
export function getVolunteerList(params) {
  return request({
    url: '/volunteers',
    method: 'get',
    params
  })
}

// 获取志愿者详情
export function getVolunteerDetail(id) {
  return request({
    url: `/volunteers/${id}`,
    method: 'get'
  })
}

// 获取志愿者服务记录
export function getVolunteerServiceRecords(id) {
  return request({
    url: `/volunteers/${id}/services`,
    method: 'get'
  })
}

// 添加志愿者
export function addVolunteer(data) {
  return request({
    url: '/volunteers',
    method: 'post',
    data
  })
}

// 更新志愿者
export function updateVolunteer(id, data) {
  return request({
    url: `/volunteers/${id}`,
    method: 'put',
    data
  })
}

// 删除志愿者
export function deleteVolunteer(id) {
  return request({
    url: `/volunteers/${id}`,
    method: 'delete'
  })
}

// 修改志愿者状态
export function changeVolunteerStatus(id, status) {
  return request({
    url: `/volunteers/${id}/status`,
    method: 'post',
    data: { status }
  })
}

// 重置志愿者密码
export function resetVolunteerPassword(id) {
  return request({
    url: `/volunteers/${id}/reset-password`,
    method: 'put'
  })
} 